package com.sunny.wordstudy;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.graphics.Typeface;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.text.Html;
import android.util.DisplayMetrics;
import android.view.Display;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.WindowManager;
import android.widget.AbsoluteLayout;
import android.widget.AbsoluteLayout.LayoutParams;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;
import com.sunny.wordstudy.lib.Stat;
import com.sunny.wordstudy.lib.Study;

public class StudyView extends Activity
{
  static final int[] colors;
  Button btnFive;
  private View.OnClickListener btnFivehandler = new 5(this);
  Button btnFour;
  private View.OnClickListener btnFourhandler = new 4(this);
  Button btnOne;
  private View.OnClickListener btnOnehandler = new 2(this);
  Button btnThree;
  private View.OnClickListener btnThreehandler = new 3(this);
  String[] chooseItems;
  ListView chooseList;
  AdapterView.OnItemClickListener chooseListHandler = new 1(this);
  TextView dbStatus;
  TextView hintStatus;
  Stat iStat = Stat.getInstance();
  Study iStudy = Study.getInstance();
  AbsoluteLayout mainView;
  ProgressDialog myProgressDialog = null;
  long nIntroduceNumTilLastSession = 0L;
  int waitShowType;
  TextView wordHintText;
  TextView wordMeanText;
  TextView wordRelText;
  TextView wordSampleText;
  TextView wordText;
  TextView wordVoiceText;

  static
  {
    int[] arrayOfInt = new int[12];
    arrayOfInt[0] = -16777216;
    arrayOfInt[1] = -16776961;
    arrayOfInt[2] = -16711681;
    arrayOfInt[3] = -12303292;
    arrayOfInt[4] = -7829368;
    arrayOfInt[5] = -16711936;
    arrayOfInt[6] = -3355444;
    arrayOfInt[7] = -65281;
    arrayOfInt[8] = -65536;
    arrayOfInt[9] = -1;
    arrayOfInt[11] = -256;
    colors = arrayOfInt;
  }

  private void doEndSession()
  {
    new AlertDialog.Builder(this).setTitle("结束学习").setMessage("确定要结束学习码?").setPositiveButton(getResources().getString(2131165202), new 6(this)).setNegativeButton(getResources().getString(2131165203), new 7(this)).show();
  }

  private void doLayout()
  {
    SharedPreferences localSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
    int i = getIntSetting(localSharedPreferences.getString("wordlines", "1"), 1);
    DisplayMetrics localDisplayMetrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(localDisplayMetrics);
    int j = localDisplayMetrics.widthPixels;
    int k = localDisplayMetrics.heightPixels - Math.round(50.0F * getResources().getDisplayMetrics().density);
    AbsoluteLayout localAbsoluteLayout = new AbsoluteLayout(this);
    this.mainView = localAbsoluteLayout;
    setContentView(this.mainView);
    AbsoluteLayout.LayoutParams localLayoutParams1 = new AbsoluteLayout.LayoutParams(localDisplayMetrics.widthPixels, localDisplayMetrics.heightPixels, 0, 0);
    TextView localTextView1 = new TextView(this);
    this.dbStatus = localTextView1;
    int l = 3 + Math.round(this.dbStatus.getTextSize());
    AbsoluteLayout.LayoutParams localLayoutParams2 = new AbsoluteLayout.LayoutParams(j, l, 0, 0);
    this.dbStatus.setGravity(17);
    this.mainView.addView(this.dbStatus, localLayoutParams2);
    TextView localTextView2 = new TextView(this);
    this.wordText = localTextView2;
    this.wordText.setTextSize(getIntSetting(localSharedPreferences.getString("wordfontsize", "28"), 28));
    int i1 = getColorSetting(localSharedPreferences.getString("wordfontcolor", "0"), -16776961);
    if (i1 != -1)
      this.wordText.setTextColor(i1);
    TextView localTextView3 = new TextView(this);
    this.wordVoiceText = localTextView3;
    this.wordVoiceText.setTextSize(getIntSetting(localSharedPreferences.getString("wordvoicefontsize", "18"), 18));
    int i2 = getColorSetting(localSharedPreferences.getString("wordvoicefontcolor", "0"), -16711681);
    if (i2 != -1)
      this.wordVoiceText.setTextColor(i2);
    TextView localTextView4 = new TextView(this);
    this.wordHintText = localTextView4;
    TextView localTextView5 = new TextView(this);
    this.wordMeanText = localTextView5;
    this.wordMeanText.setTextSize(getIntSetting(localSharedPreferences.getString("wordmeanfontsize", "24"), 24));
    int i3 = getColorSetting(localSharedPreferences.getString("wordmeanfontcolor", "0"), -16711936);
    if (i3 != -1)
      this.wordMeanText.setTextColor(i3);
    TextView localTextView6 = new TextView(this);
    this.wordRelText = localTextView6;
    this.wordRelText.setTextSize(getIntSetting(localSharedPreferences.getString("wordsamplefontsize", "18"), 18));
    int i4 = getColorSetting(localSharedPreferences.getString("wordsamplefontcolor", "-1"), -1);
    if (i4 != -1)
      this.wordRelText.setTextColor(i4);
    TextView localTextView7 = new TextView(this);
    this.wordSampleText = localTextView7;
    this.wordSampleText.setTextSize(getIntSetting(localSharedPreferences.getString("wordsamplefontsize", "18"), 18));
    int i5 = getColorSetting(localSharedPreferences.getString("wordsamplefontcolor", "-1"), -1);
    if (i5 != -1)
      this.wordSampleText.setTextColor(i5);
    ListView localListView = new ListView(this);
    this.chooseList = localListView;
    TextView localTextView8 = new TextView(this);
    this.hintStatus = localTextView8;
    Button localButton1 = new Button(this);
    this.btnOne = localButton1;
    this.btnOne.setOnClickListener(this.btnOnehandler);
    Button localButton2 = new Button(this);
    this.btnThree = localButton2;
    this.btnThree.setOnClickListener(this.btnThreehandler);
    Button localButton3 = new Button(this);
    this.btnFour = localButton3;
    this.btnFour.setOnClickListener(this.btnFourhandler);
    Button localButton4 = new Button(this);
    this.btnFive = localButton4;
    this.btnFive.setOnClickListener(this.btnFivehandler);
    int i6 = 0 + l;
    int i7 = 2 + Math.round(this.wordText.getTextSize());
    int i8 = 2 + Math.round(this.wordVoiceText.getTextSize());
    int i9 = 1 + Math.round(this.wordHintText.getTextSize());
    int i10 = 1 + Math.round(this.hintStatus.getTextSize());
    int i11 = i7 * i + i7 / 4;
    Math.round(this.btnOne.getTextSize());
    int i12 = 4 + this.btnOne.getLineHeight() + this.btnOne.getPaddingBottom() + this.btnOne.getPaddingTop();
    int i13 = 5 * 2 / (4 - 1);
    int i14 = (localLayoutParams1.width - (5 * 4)) / 4;
    AbsoluteLayout.LayoutParams localLayoutParams3 = new AbsoluteLayout.LayoutParams(localLayoutParams1);
    localLayoutParams3.x = (5 + localLayoutParams3.x);
    localLayoutParams3.width -= 5;
    localLayoutParams3.y = (i6 + localLayoutParams3.y);
    localLayoutParams3.height = (i11 + 3);
    this.mainView.addView(this.wordText, localLayoutParams3);
    int i15 = i6 + i11 + 3;
    AbsoluteLayout.LayoutParams localLayoutParams4 = new AbsoluteLayout.LayoutParams(localLayoutParams1);
    localLayoutParams4.x = (5 + localLayoutParams4.x);
    localLayoutParams4.width -= 5;
    localLayoutParams4.y = (i15 + localLayoutParams4.y);
    localLayoutParams4.height = i8;
    this.mainView.addView(this.wordVoiceText, localLayoutParams4);
    int i16 = i15 + i8;
    AbsoluteLayout.LayoutParams localLayoutParams5 = new AbsoluteLayout.LayoutParams(localLayoutParams1);
    localLayoutParams5.y += i16 - i8 - i11;
    localLayoutParams5.x = (localLayoutParams5.width - 70);
    localLayoutParams5.width = 70;
    localLayoutParams5.height = (2 + i9 * 2);
    this.mainView.addView(this.wordHintText, localLayoutParams5);
    AbsoluteLayout.LayoutParams localLayoutParams6 = new AbsoluteLayout.LayoutParams(localLayoutParams1);
    localLayoutParams6.x = (5 + localLayoutParams6.x);
    localLayoutParams6.width -= 5 * 2;
    localLayoutParams6.y = (k - i12 - i10 - 10);
    localLayoutParams6.height = (i10 + 5);
    this.mainView.addView(this.hintStatus, localLayoutParams6);
    AbsoluteLayout.LayoutParams localLayoutParams7 = new AbsoluteLayout.LayoutParams(localLayoutParams1);
    localLayoutParams7.y = (i16 + localLayoutParams7.y);
    localLayoutParams7.x = (5 + localLayoutParams7.x);
    localLayoutParams7.height = (k - i16 - i12 - 10 - i10);
    int i17 = localLayoutParams7.width;
    (5 * 2);
    localLayoutParams7.width = (i17 - (5 + 10));
    this.mainView.addView(this.wordMeanText, localLayoutParams7);
    this.mainView.addView(this.wordRelText, localLayoutParams7);
    this.mainView.addView(this.wordSampleText, localLayoutParams7);
    this.mainView.addView(this.chooseList, localLayoutParams7);
    AbsoluteLayout.LayoutParams localLayoutParams8 = new AbsoluteLayout.LayoutParams(localLayoutParams1);
    localLayoutParams8.x = 5;
    localLayoutParams8.y = (k - i12 - 3);
    localLayoutParams8.width = i14;
    localLayoutParams8.height = i12;
    this.mainView.addView(this.btnOne, localLayoutParams8);
    AbsoluteLayout.LayoutParams localLayoutParams9 = new AbsoluteLayout.LayoutParams(localLayoutParams8);
    localLayoutParams9.x = (i14 + 5 + i13);
    localLayoutParams9.y = localLayoutParams8.y;
    this.mainView.addView(this.btnThree, localLayoutParams9);
    AbsoluteLayout.LayoutParams localLayoutParams10 = new AbsoluteLayout.LayoutParams(localLayoutParams8);
    localLayoutParams10.x = (5 + i13 * 2 + i14 * 2);
    localLayoutParams10.y = localLayoutParams8.y;
    this.mainView.addView(this.btnFour, localLayoutParams10);
    AbsoluteLayout.LayoutParams localLayoutParams11 = new AbsoluteLayout.LayoutParams(localLayoutParams8);
    localLayoutParams11.x = (5 + i13 * 3 + i14 * 3);
    localLayoutParams11.y = localLayoutParams8.y;
    this.mainView.addView(this.btnFive, localLayoutParams11);
  }

  private void doSetCmdList()
  {
    int i;
    if ((this.iStudy.getWordStatus() == 0) && ((((0xF & (int)this.iStat.getSessionType()) == 1) || ((0xF & (int)this.iStat.getSessionType()) == 2))))
    {
      i = 0;
      if (i >= this.iStat.getWordShowPos())
        switch (0xF & (byte)(int)this.iStat.getSessionType())
        {
        default:
          label42: this.chooseItems[i] = String.valueOf(i + 1) + "." + this.iStat.getStudyWordMean();
          label129: if (i < 3)
            break label312;
          this.chooseList.setAdapter(new ArrayAdapter(this, 17367043, this.chooseItems));
          this.chooseList.setOnItemClickListener(this.chooseListHandler);
          this.chooseList.setVisibility(0);
        case 1:
        case 2:
        }
    }
    while (true)
    {
      return;
      this.chooseItems[i] = String.valueOf(i + 1) + "." + this.iStat.getChooseItem(i);
      ++i;
      break label42:
      this.chooseItems[i] = String.valueOf(i + 1) + "." + this.iStat.getStudyWordMean();
      break label129:
      this.chooseItems[i] = String.valueOf(i + 1) + "." + this.iStat.getStudyWord();
      break label129:
      label312: this.chooseItems[(i + 1)] = String.valueOf(i + 2) + "." + this.iStat.getChooseItem(i);
      ++i;
      break label129:
      this.chooseList.setVisibility(4);
      if (((this.iStat.isTestMode()) && (this.iStudy.isShowAns()) && (((this.iStat.getLastStudyStat() == 0L) || (this.iStat.getLastStudyStat() == 2L)))) || (this.iStat.isTestMode()) || (!(this.iStudy.isShowAns())) || (this.iStat.getLastStudyStat() != 1L) || (this.iStudy.getRecallStudy() != 1))
        continue;
    }
  }

  private void doShowSessionStatus()
  {
    startActivity(new Intent(this, StudyStatusView.class));
  }

  private int getColorSetting(String paramString, int paramInt)
  {
    int i = Integer.parseInt(paramString);
    if (i == 0);
    for (int j = paramInt; ; j = i)
      while (true)
      {
        return j;
        if ((i <= 0) || (i > 12))
          break;
        j = colors[(i - 1)];
      }
  }

  private int getIntSetting(String paramString, int paramInt)
  {
    int i = Integer.parseInt(paramString);
    if (i == 0);
    for (int j = paramInt; ; j = i)
      return j;
  }

  public static String replaceStr(String paramString1, String paramString2, String paramString3)
  {
    String str2;
    if (paramString1.length() == 0)
    {
      str2 = "";
      return str2;
    }
    String str1 = "";
    while (true)
    {
      if (paramString1.indexOf(paramString2) == -1)
        str2 = str1 + paramString1;
      int i = paramString1.indexOf(paramString2);
      if (i == paramString1.length())
        continue;
      str1 = str1 + paramString1.substring(0, i) + paramString3;
      paramString1 = paramString1.substring(i + paramString2.length(), paramString1.length());
    }
  }

  private void setDBStatus()
  {
    TextView localTextView = this.dbStatus;
    StringBuilder localStringBuilder1 = new StringBuilder(String.valueOf(this.iStat.getStudyBookName())).append(" ");
    Resources localResources1 = getResources();
    Object[] arrayOfObject1 = new Object[2];
    arrayOfObject1[0] = Long.valueOf(this.nIntroduceNumTilLastSession + this.iStat.getIntroduceNum());
    arrayOfObject1[1] = Long.valueOf(this.iStat.getBookWords());
    String str = localResources1.getString(2131165189, arrayOfObject1);
    long l = this.iStat.getTotalLearnedTime() + this.iStat.getSessionLearnedTime() / 60L;
    StringBuilder localStringBuilder2 = new StringBuilder(String.valueOf(str)).append(" ");
    Resources localResources2 = getResources();
    Object[] arrayOfObject2 = new Object[2];
    arrayOfObject2[0] = Long.valueOf(l / 60L);
    arrayOfObject2[1] = Long.valueOf(l % 60L);
    localTextView.setText(localResources2.getString(2131165188, arrayOfObject2));
  }

  private void setVoiceFont()
  {
    if (!(this.iStat.getStudyLang().equals("en")))
      return;
    Typeface localTypeface = Typeface.createFromAsset(getApplicationContext().getAssets(), "fonts/WSEnVoice.ttf");
    this.wordVoiceText.setTypeface(localTypeface);
  }

  public boolean DoInputWord(String paramString1, String paramString2)
  {
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
    localBuilder.setIcon(getResources().getDrawable(2130837504));
    localBuilder.setTitle(getResources().getString(2131165223));
    localBuilder.setMessage(paramString1);
    EditText localEditText = new EditText(this);
    localBuilder.setView(localEditText);
    localBuilder.setPositiveButton(getResources().getString(2131165202), new 8(this, localEditText));
    localBuilder.setNegativeButton(getResources().getString(2131165203), new 9(this));
    localBuilder.show();
    return false;
  }

  public void ReformDataInfo()
  {
    setDBStatus();
    new String();
    Object[] arrayOfObject1 = new Object[4];
    arrayOfObject1[0] = Long.valueOf(this.iStat.getWordLearnNum());
    arrayOfObject1[1] = Long.valueOf(this.iStat.getWordForgetNum());
    arrayOfObject1[2] = this.iStat.getWordRp();
    arrayOfObject1[3] = "%";
    String str1 = String.format("学%d/%d \n记%s%s", arrayOfObject1);
    this.wordHintText.setText(str1);
    new String();
    Object[] arrayOfObject2 = new Object[7];
    arrayOfObject2[0] = Long.valueOf(this.iStat.getAllWordOkNum());
    arrayOfObject2[1] = Long.valueOf(this.iStat.getAllStudiedNum());
    arrayOfObject2[2] = Long.valueOf(this.iStat.getBlockWordOkNum());
    arrayOfObject2[3] = Long.valueOf(this.iStat.getReviewNum());
    arrayOfObject2[4] = Long.valueOf(this.iStat.getIntroduceNum());
    arrayOfObject2[5] = Long.valueOf(this.iStat.getTestOkNum());
    arrayOfObject2[6] = Long.valueOf(this.iStat.getTestFailNum());
    String str2 = String.format("记:%d/%d 本次-记:%d复:%d新:%d (对 %d/错 %d)", arrayOfObject2);
    this.hintStatus.setText(str2);
    switch (this.iStudy.getWordStatus())
    {
    default:
      if (!(this.iStudy.isShowStatus()))
        doSetCmdList();
      if ((((!(this.iStat.isTestMode())) || (!(this.iStudy.isShowAns())) || ((this.iStat.getLastStudyStat() != 0L) && (this.iStat.getLastStudyStat() != 2L)))) && (!(this.iStat.isTestMode())) && (this.iStudy.isShowAns()) && (this.iStat.getLastStudyStat() == 1L))
        this.iStudy.getRecallStudy();
      return;
    case 0:
      String str3 = this.iStat.getStudyWord();
      this.wordText.setText(str3);
      this.wordVoiceText.setText(this.iStat.getStudyWordVoice());
      this.wordMeanText.setText(this.iStat.getStudyWordMean());
      this.wordMeanText.setVisibility(4);
      String str4 = this.iStat.getStudyWordSample();
      String str5;
      Object localObject1;
      int i;
      String str9;
      if (str4.length() == 0)
      {
        str5 = getResources().getString(2131165216);
        this.wordSampleText.setText(Html.fromHtml(str5));
        this.wordSampleText.setVisibility(4);
        String str6 = this.iStat.getStudyWordRel();
        if (str6.length() == 0)
          str6 = getResources().getString(2131165217);
        this.wordRelText.setText(str6);
        this.wordRelText.setVisibility(4);
        if (((0xF & this.iStat.getSessionType()) != 2L) && ((0xF & this.iStat.getSessionType()) != 1L))
          break label1188;
        new String();
        Object[] arrayOfObject3 = new Object[2];
        arrayOfObject3[0] = Long.valueOf(this.iStat.getTestOkNum());
        arrayOfObject3[1] = Long.valueOf(this.iStat.getTestFailNum());
        String str7 = String.format(" 用 1 2 3 4 选择答案 本次 (对 %d/错 %d)", arrayOfObject3);
        this.hintStatus.setText(str7);
        if ((0xF & this.iStat.getSessionType()) == 2L)
        {
          this.wordText.setText(this.iStat.getStudyWordMean());
          this.wordVoiceText.setVisibility(4);
        }
        localObject1 = "";
        i = 0;
        if (i < this.iStat.getWordShowPos())
          break label921;
        switch (0xF & (byte)(int)this.iStat.getSessionType())
        {
        default:
          str9 = String.valueOf(i + 1) + "." + this.iStat.getStudyWordMean();
          if (((String)localObject1).length() <= 0);
        case 1:
        case 2:
        }
      }
      for (Object localObject2 = localObject1 + "\n" + str9; i >= 3; localObject2 = str9)
      {
        this.wordMeanText.setText((CharSequence)localObject2);
        this.btnOne.setText("选1");
        this.btnOne.setVisibility(0);
        this.btnThree.setText("选2");
        this.btnThree.setVisibility(0);
        this.btnFour.setText("选3");
        this.btnFour.setVisibility(0);
        this.btnFive.setText("选4");
        this.btnFive.setVisibility(0);
        this.wordMeanText.setVisibility(4);
        this.btnOne.setVisibility(0);
        this.wordSampleText.setVisibility(4);
        this.wordRelText.setVisibility(4);
        break label240:
        str5 = replaceStr(replaceStr(str4, str3, "<strong><font color=\"blue\">" + str3 + "</font></strong>"), "\n", "<br/>");
        break label424:
        String str8 = String.valueOf(i + 1) + "." + this.iStat.getChooseItem(i);
        if (((String)localObject1).length() > 0);
        for (localObject1 = localObject1 + "\n" + str8; ; localObject1 = str8)
        {
          ++i;
          break label633:
        }
        str9 = String.valueOf(i + 1) + "." + this.iStat.getStudyWordMean();
        break label718:
        str9 = String.valueOf(i + 1) + "." + this.iStat.getStudyWord();
        break label718:
      }
      String str10 = String.valueOf(i + 2) + "." + this.iStat.getChooseItem(i);
      if (((String)localObject2).length() > 0);
      for (localObject2 = localObject2 + "\n" + str10; ; localObject2 = str10)
      {
        ++i;
        break label754:
      }
      if (((0xF & this.iStat.getSessionType()) == 3L) || ((0xF & this.iStat.getSessionType()) == 4L))
      {
        if ((0xF & this.iStat.getSessionType()) == 3L)
        {
          this.wordText.setText(this.iStat.getStudyWordMean());
          this.wordVoiceText.setVisibility(4);
        }
        this.btnOne.setText("拼写");
      }
      while (true)
      {
        this.btnThree.setVisibility(0);
        this.btnThree.setText("不认识");
        this.btnFour.setVisibility(4);
        this.btnFive.setText("例句");
        this.btnFive.setVisibility(4);
        this.wordMeanText.setVisibility(4);
        break label849:
        this.btnOne.setText("认识");
      }
    case 1:
      label240: label633: this.wordText.setText(this.iStat.getStudyWord());
      label424: label718: label754: this.wordVoiceText.setVisibility(0);
      label849: this.wordMeanText.setVisibility(4);
      label921: label1188: this.wordMeanText.setText(this.iStat.getStudyWordMean());
      if (this.iStudy.isShowSample())
      {
        this.wordMeanText.setVisibility(4);
        this.wordSampleText.setVisibility(0);
        this.wordRelText.setVisibility(4);
        label1420: this.btnOne.setText("正确");
        this.btnThree.setText("错误");
        if (!(this.iStudy.isShowRel()))
          break label1563;
        this.btnFour.setText("词义");
        label1460: this.btnFour.setVisibility(0);
        if (!(this.iStudy.isShowSample()))
          break label1576;
        this.btnFive.setText("词义");
      }
      while (true)
      {
        this.btnFive.setVisibility(0);
        break label240:
        if (this.iStudy.isShowRel())
        {
          this.wordMeanText.setVisibility(4);
          this.wordSampleText.setVisibility(4);
          this.wordRelText.setVisibility(0);
        }
        this.wordMeanText.setVisibility(0);
        this.wordSampleText.setVisibility(4);
        this.wordRelText.setVisibility(4);
        break label1420:
        label1563: this.btnFour.setText("关系");
        break label1460:
        label1576: this.btnFive.setText("例句");
      }
    case 2:
    }
    this.wordText.setText(this.iStat.getStudyWord());
    this.wordVoiceText.setVisibility(0);
    this.wordMeanText.setVisibility(0);
    this.wordMeanText.setText(this.iStat.getStudyWordMean());
    if (this.iStudy.isShowSample())
    {
      this.wordMeanText.setVisibility(4);
      this.wordSampleText.setVisibility(0);
      this.wordRelText.setVisibility(4);
      label1667: this.btnOne.setText("下一个");
      this.btnThree.setText("发音");
      if (!(this.iStudy.isShowRel()))
        break label1810;
      this.btnFour.setText("词义");
      label1707: this.btnFour.setVisibility(0);
      if (!(this.iStudy.isShowSample()))
        break label1823;
      this.btnFive.setText("词义");
    }
    while (true)
    {
      this.btnFive.setVisibility(0);
      break label240:
      if (this.iStudy.isShowRel())
      {
        this.wordMeanText.setVisibility(4);
        this.wordSampleText.setVisibility(4);
        this.wordRelText.setVisibility(0);
      }
      this.wordMeanText.setVisibility(0);
      this.wordSampleText.setVisibility(4);
      this.wordRelText.setVisibility(4);
      break label1667:
      label1810: this.btnFour.setText("关系");
      break label1707:
      label1823: this.btnFive.setText("例句");
    }
  }

  public int ShowConfirm(int paramInt)
  {
    SharedPreferences localSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
    switch (paramInt)
    {
    default:
    case 1:
    case 2:
    }
    while (true)
    {
      return 0;
      new String();
      String str1 = getResources().getString(2131165220);
      Object[] arrayOfObject = new Object[3];
      arrayOfObject[0] = Long.valueOf(this.iStat.getTestOkNum() + this.iStat.getTestFailNum());
      arrayOfObject[1] = Long.valueOf(this.iStat.getTestOkNum());
      arrayOfObject[2] = Long.valueOf(this.iStat.getTestFailNum());
      String str2 = String.format(str1, arrayOfObject);
      new AlertDialog.Builder(this).setIcon(2130837504).setTitle(getResources().getString(2131165219)).setMessage(str2).setNegativeButton(getResources().getString(2131165203), new 11(this)).setPositiveButton(getResources().getString(2131165202), new 12(this)).show();
      continue;
      if (localSharedPreferences.getBoolean("confirmmarkforever", true))
        new AlertDialog.Builder(this).setIcon(2130837504).setTitle("标志永久记住").setCancelable(false).setMessage("确定要标志永久记住吗？").setNegativeButton(getResources().getString(2131165203), new 13(this)).setPositiveButton(getResources().getString(2131165202), new 14(this)).show();
      this.iStudy.DealKeyPress(122);
    }
  }

  public int ShowInputResult(int paramInt)
  {
    String str = "";
    switch (paramInt)
    {
    case 0:
    default:
      label32: if (str.equals(""))
        break label124;
      new AlertDialog.Builder(this).setIcon(2130837504).setTitle("标志永久记住").setCancelable(false).setMessage(str).setPositiveButton(getResources().getString(2131165202), new 10(this)).show();
    case 1:
    case 2:
    }
    while (true)
    {
      return 0;
      str = getResources().getString(2131165221);
      break label32:
      str = getResources().getString(2131165222);
      break label32:
      label124: this.iStudy.SecondStep(0, "0");
    }
  }

  public void cancelWait(int paramInt)
  {
    if (this.myProgressDialog != null);
    try
    {
      this.myProgressDialog.dismiss();
      this.myProgressDialog = null;
      return;
    }
    catch (Exception localException)
    {
    }
  }

  public void checkRegInfo(int paramInt)
  {
    if ((paramInt != 1) || (this.myProgressDialog != null))
      return;
    new AlertDialog.Builder(this).setIcon(2130837504).setTitle("未注册").setCancelable(false).setMessage("您还没有注册，请到www.exuexi.com注册获得完整功能，支持作者发展本软件").setPositiveButton(getResources().getString(2131165202), new 15(this)).show();
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    this.iStudy.setView(this);
    String[] arrayOfString = new String[4];
    arrayOfString[0] = "1";
    arrayOfString[1] = "2";
    arrayOfString[2] = "3";
    arrayOfString[3] = "4";
    this.chooseItems = arrayOfString;
    doLayout();
    setVoiceFont();
    this.nIntroduceNumTilLastSession = this.iStat.getTotalIntroducedWords();
    setDBStatus();
    SharedPreferences localSharedPreferences;
    try
    {
      localSharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);
      if (localSharedPreferences.getBoolean("recallstudymode", false))
      {
        this.iStudy.setRecallStudy(1);
        if (!(localSharedPreferences.getBoolean("showwordhint", true)))
          break label212;
        this.wordHintText.setVisibility(0);
        label119: this.iStat.setUseRandomWord(localSharedPreferences.getBoolean("userandomword", false));
        if (!(localSharedPreferences.getBoolean("lastlearnmode", true)))
          break label223;
        setTitle(2131165186);
        this.iStudy.BeginSession(Integer.parseInt(localSharedPreferences.getString("studymode", "0")));
        label181: ReformDataInfo();
        return;
      }
      label212: label223: this.iStudy.setRecallStudy(0);
    }
    catch (Exception localException)
    {
      this.wordSampleText.setText(localException.getMessage());
      break label181:
      this.wordHintText.setVisibility(4);
      break label119:
      setTitle(2131165204);
      this.iStudy.BeginSession(Integer.parseInt(localSharedPreferences.getString("testmode", "17")));
      break label181:
    }
  }

  public boolean onCreateOptionsMenu(Menu paramMenu)
  {
    super.onCreateOptionsMenu(paramMenu);
    paramMenu.add(0, 0, 0, "标志永久记住");
    paramMenu.add(0, 1, 1, "发音");
    paramMenu.add(0, 2, 2, "查看状态");
    paramMenu.add(0, 3, 3, "结束学习");
    return true;
  }

  protected void onDestroy()
  {
    this.iStudy.EndSession();
    super.onDestroy();
  }

  public boolean onOptionsItemSelected(MenuItem paramMenuItem)
  {
    switch (paramMenuItem.getItemId())
    {
    default:
    case 0:
    case 1:
    case 2:
    case 3:
    }
    while (true)
    {
      return true;
      this.iStudy.DealKeyPress(57);
      continue;
      this.iStudy.DealKeyPress(50);
      continue;
      doShowSessionStatus();
      continue;
      doEndSession();
    }
  }

  public int showWait(int paramInt)
  {
    if (this.myProgressDialog == null)
    {
      this.waitShowType = paramInt;
      this.myProgressDialog = new ProgressDialog(this);
      this.myProgressDialog.setTitle(getResources().getString(2131165211));
      this.myProgressDialog.setIcon(2130837504);
      switch (this.waitShowType)
      {
      default:
      case 1:
      case 3:
      case 2:
      }
    }
    while (true)
    {
      this.myProgressDialog.show();
      new 16(this).start();
      return 0;
      this.myProgressDialog.setMessage(getResources().getString(2131165215));
      continue;
      this.myProgressDialog.setMessage(getResources().getString(2131165214));
      this.myProgressDialog.setMessage(getResources().getString(2131165218));
    }
  }
}

/* Location:           E:\Desktop\Android\yanguangbeidanci\classes_dex2jar.jar
 * Qualified Name:     com.sunny.wordstudy.StudyView
 * JD-Core Version:    0.5.3
 */